package com.goodving.guli.server.sync;

import android.text.TextUtils;
import android.util.Base64;

import com.goodving.guli.bt.profile.scale.GuliLog;
import com.goodving.guli.view.C3657a;

import org.json.JSONException;
import org.json.JSONObject;

/* renamed from: cn.com.smartdevices.bracelet.shoes.sync.b.g */
public class SyncServerData { // C1667g
    public static final String f8315a = "date";
    public static final String f8316b = "data";
    public static final String f8317c = "type";
    public static final String f8318d = "heartrate";
    public static final String f8319e = "summary";
    public static final String f8320f = "userid";
    public static final String f8321g = "next_to_date";
    public static final String f8322h = "fromdate";
    public static final String f8323i = "todate";
    public static final String f8324j = "brand";
    public static final String f8325k = "brand_type";
    public static final String f8326l = "count";
    public static final String f8327m = "is_data";
    public static final String f8328n = "uuid";
    public static final String f8329o = "dates";
    public static final String f8330p = "sn";
    public static final String f8331q = "mac";
    public static final String f8332r = "device";
    public static final String f8333s = "shoe_version";
    public static final String f8334t = "deviceid";
    private static final String TAG = "SyncServerData";
    private String f8336A;
    private byte[] f8337B;
    private String f8338C;
    public int f8339u;
    public String f8340v;
    public String f8341w;
    public String f8342x;
    private final int f8343z;

    public SyncServerData() {
        this.f8343z = 0;
        this.f8336A = null;
        this.f8337B = null;
        this.f8338C = null;
        this.f8339u = -1;
        this.f8340v = null;
        this.f8341w = null;
        this.f8342x = null;
    }

    public SyncServerData(String str) {
        this.f8343z = 0;
        this.f8336A = null;
        this.f8337B = null;
        this.f8338C = null;
        this.f8339u = -1;
        this.f8340v = null;
        this.f8341w = null;
        this.f8342x = null;
        this.f8337B = str.getBytes();
    }

    public SyncServerData(String str, String str2) {
        this.f8343z = 0; // C1599d.f7999a
        this.f8336A = null;
        this.f8337B = null;
        this.f8338C = null;
        this.f8339u = -1;
        this.f8340v = null;
        this.f8341w = null;
        this.f8342x = null;
        this.f8337B = str2.getBytes();
        this.f8338C = str;
    }

    public SyncServerData(String str, byte[] bArr) {
        this.f8343z = 0;
        this.f8336A = null;
        this.f8337B = null;
        this.f8338C = null;
        this.f8339u = -1;
        this.f8340v = null;
        this.f8341w = null;
        this.f8342x = null;
        this.f8337B = bArr;
        this.f8338C = str;
    }

    public SyncServerData(byte[] bArr) {
        this.f8343z = 0;
        this.f8336A = null;
        this.f8337B = null;
        this.f8338C = null;
        this.f8339u = -1;
        this.f8340v = null;
        this.f8341w = null;
        this.f8342x = null;
        this.f8337B = bArr;
    }

    public String m13076a() {
        return this.f8336A;
    }

    public void m13077a(String str) {
        this.f8336A = str;
    }

    public String m13078b() {
        return this.f8337B == null ? C3657a.f18328f : Base64.encodeToString(this.f8337B, 2);
    }

    public byte[] m13079c() {
        return this.f8337B;
    }

    public String m13080d() {
        return this.f8338C;
    }

    public int m13081e() {
        return this.f8343z;
    }

    public JSONObject m13082f() {
        JSONObject jSONObject = new JSONObject();
        try {
            if (!TextUtils.isEmpty(this.f8336A)) {
                jSONObject.put(f8315a, this.f8336A);
            }
            if (this.f8337B != null) {
                jSONObject.put(f8316b, Base64.encodeToString(this.f8337B, 2));
            }
            if (!TextUtils.isEmpty(this.f8338C)) {
                jSONObject.put(f8319e, this.f8338C);
            }
        } catch (JSONException e) {
            GuliLog.tracePrintInfo(TAG, "toJSONObject:" + e.getMessage());
        }
        return jSONObject;
    }
}
